package com.dream.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dream.commons.result.PageInfo;
import com.dream.sys.base.BaseController;
import com.dream.sys.model.SysLog;
import com.dream.sys.model.DTO.SysLogReqDto;
import com.dream.sys.service.SysLogService;

/**
 * @description：日志管理
 */
@Controller
@RequestMapping("/sysLog")
public class SysLogController extends BaseController {
   @Autowired
   private SysLogService sysLogService;

	@GetMapping("/manager")
    public String manager() {
        return "admin/syslog";
    }


    @GetMapping("/dataGrid")
    @ResponseBody
    public PageInfo<SysLog> dataGrid(SysLogReqDto sysLogReqDto) {     
    	PageInfo<SysLog> p =  sysLogService.selectDataGrid(sysLogReqDto);
        return p;
    }
    
    /**
     * 删除log
     * @param
     * @return
     */
    @PostMapping(value = "del")
    @ResponseBody
    public Object del(String[] ids){
    	String msg="删除成功";
        sysLogService.deleteLogs(ids);
        return renderSuccess(msg);
    }
}
